<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.db.conn"%>
<%@ page import="java.sql.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<script src="<%=path %>/admin/js/jquery.js" type="text/javascript"></script>
<script src="<%=path %>/admin/js/formValidator.js" type="text/javascript"></script>  
<script src="<%=path %>/admin/js/formValidatorRegex.js" type="text/javascript"></script>
<link href="<%=path %>/admin/css/validator.css" rel="stylesheet" type="text/css" />


			<script type="text/javascript" src="<%=path%>/admin/js/popup_shuaxin_no.js"></script>
	<script language="javascript">     
		    
	       function up2()
	       {
		        var pop=new Popup({ contentType:1,isReloadOnClose:false,width:400,height:200});
	            pop.setContent("contentUrl","<%=path%>/upfile/upload1.jsp");
	            pop.setContent("title","文件上传");
	            pop.build();
	            pop.show();
	       }
        </script>

<jsp:include flush="true" page="${basePath}/admin/head.jsp"></jsp:include>

 <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">添加优惠券信息</h3>
            </div>
            <div class="panel-body" style="min-height: 500px;">
           <table style="width:100%;"><tr><td align="center">
          		<form  action="<%=path %>/coupon_Add" method="post">

					  <table  style="width:98%;margin-left:10px;" align="center">
                    <tbody>
                    <tr>
<td  style=" text-align:right; width:20%;"><font style='color:red'>*&nbsp;</font>优惠券标题:</td>
<td class="tbright"><div style="display:inline;float:left;">
<input name="txt_ctitle" type="text" id="txt_ctitle" style="width: 200px; " /></div><div id="txt_ctitleTip" style="width:250px;display:inline;float:left;text-align:left;"></div>
 </td></tr>

<tr>
<td  style=" text-align:right; width:20%;"><font style='color:red'>*&nbsp;</font>优惠券图片:</td>
<td class="tbright"><div style="display:inline;float:left;">
<input type="text" name="fujian" id="fujian" size="50" readonly="readonly" />
<input type="button" value="上传" onclick="up2()" />
 </td></tr>

<tr>
<td  style=" text-align:right; width:20%;"><font style='color:red'>*&nbsp;</font>满:</td>
<td class="tbright"><div style="display:inline;float:left;">
<input name="txt_cman" type="text" id="txt_cman" style="width: 200px; " /></div><div id="txt_cmanTip" style="width:250px;display:inline;float:left;text-align:left;"></div>
 </td></tr>

<tr>
<td  style=" text-align:right; width:20%;"><font style='color:red'>*&nbsp;</font>减:</td>
<td class="tbright"><div style="display:inline;float:left;">
<input name="txt_cjian" type="text" id="txt_cjian" style="width: 200px; " /></div><div id="txt_cjianTip" style="width:250px;display:inline;float:left;text-align:left;"></div>
 </td></tr>

<tr>
<td  style=" text-align:right; width:20%;"><font style='color:red'>*&nbsp;</font>库存数量:</td>
<td class="tbright"><div style="display:inline;float:left;">
<input name="txt_cquan" type="text" id="txt_cquan" style="width: 200px; " /></div><div id="txt_cquanTip" style="width:250px;display:inline;float:left;text-align:left;"></div>
 </td></tr>



    <tr>
        <td>&nbsp;</td>
        <td align="left">
        <input type="submit" name="btnAdd" value="添 加" onclick="return jQuery.formValidator.PageIsValid('1');" id="btnAdd"   class="btn btn-info" />
    <input name="btnReturn" type="button" value="返 回" class="btn btn-info"  onclick="location.href='<%=path %>/admin/coupon/coupon_Manage.jsp';"  />
    
               </td>
    </tr>
                    </tbody>
                </table>
			
    </form>
	   </td></tr></table>
            

            </div>
        </div>
	<script language="javascript" type="text/javascript">
    $(document).ready(function() {
        $.formValidator.initConfig({ onError: function(msg) { alert(msg) } });
        $("#txt_ctitle").formValidator({ onshow: "请输入优惠券标题", onfocus: "优惠券标题不能为空", oncorrect: "合法" }).InputValidator({ min: 1, onerror: "优惠券标题不能为空,请确认" });
        $("#txt_cman").formValidator({empty:false,onshow:"请输入满",onfocus:"只能输入数字",oncorrect:"合法"}).RegexValidator({regexp:"num",datatype:"enum",onerror:"只能为数字"});
        $("#txt_cjian").formValidator({empty:false,onshow:"请输入减",onfocus:"只能输入数字",oncorrect:"合法"}).RegexValidator({regexp:"num",datatype:"enum",onerror:"只能为数字"});
        $("#txt_cquan").formValidator({empty:false,onshow:"请输入库存数量",onfocus:"只能输入数字",oncorrect:"合法"}).RegexValidator({regexp:"num",datatype:"enum",onerror:"只能为数字"});
    });
</script>








